from keras.optimizers import SGD
from keras.layers.core import Flatten, Dense
from keras.models import Sequential

def creatModel():
    sgd = SGD(lr=0.1, decay=1e-6, momentum=0.9, nesterov=True)
    model=Sequential()
    model.add(Flatten(input_shape=(61,2)))
    model.add(Dense(125, activation='relu'))
    model.add(Dense(500, activation='relu'))
    model.add(Dense(250, activation='relu'))
    model.add(Dense(2, activation='relu'))
    model.compile(optimizer=sgd,loss='mean_squared_error',metrics=['accuracy'])
    return model

model=creatModel()

def fit(X,Y,batch_size):
    model.fit(X,Y,nb_epoch=10000, batch_size=batch_size, show_accuracy=True, verbose=2)